// components/tabbar/tabbar.js
Component({
    data: {
        selected: 0,
        color: '#7A7E83',
        selectedColor: '#3cc51f',
        list: [],
        show: true,
        boxShadow: true,
        border: false
    },
    lifetimes: {
        ready: function () {
            this.setData({ list: getApp().globalData.list })
        }
    },
    methods: {
        onChange(e) {
            const url = this.data.list[e.detail].pagePath
            if (!url) return
            wx.switchTab({
                url
            })
            this.setData({
                selected: e.detail
            })
        },
        hidden() {
            this.setData({
                show: false
            })
        },
        show() {
            this.setData({
                show: true
            })
        }
    }
})
